package com.wj.core.serialize;

import com.wj.core.serialize.impl.HessianSerialize;

/**
 * @author: wangjun
 * @create: 2018-06-01 
 **/
public abstract class Serializer {

  public abstract <T> byte[] serialize(T object);

  public abstract <T> Object deserrialize(byte[] bytes, Class<T> Class);

  public enum SerializeEnum {

    HESSIAN(new HessianSerialize());

    public final Serializer serializer;

    private SerializeEnum(Serializer serializer) {
      this.serializer = serializer;
    }

    public static SerializeEnum getSerializer() {
      return SerializeEnum.HESSIAN;
    }

  }
}
